<template>
  <div class="wholeView">
    <el-table :data="tableData"
              size="mini"
              border
              v-loading="tableLoading"
              :header-cell-style="{
                    background: '#0070C0',
                    color: '#ffffff'
                }"
              style="width: 100%">
      <BaseColumns :columns="columns"></BaseColumns>
    </el-table>
  </div>
</template>

<script>
import { managementSubject } from "@/api/barCode/index";
export default {
  name: "wholeView",
  components: {},
  props: {
    form: {
      type: Object,
      default: {},
    },
  },
  data () {
    return {
      tableLoading: false,
      tableData: [],
      columns: [],
    };
  },
  computed: {

  },
  created () { },
  mounted () { },
  methods: {
    getList () {
      this.tableData = []
      this.tableLoading = true;
      managementSubject(this.form).then((res) => {
        if (res.code == 200) {
          this.tableLoading = false;
          this.columns = [
            {
              label: "",
              prop: "index_name",
              width: "100",
              align: "center",
              fixed: 'left'
            },
            ...res.data.area.map(i => {
              return {
                label: i,
                prop: i,
                width: "100",
                align: "center"
              };
            })
          ];
          this.tableData = res.data.data;
        }
      });
    },
  },
};
</script>

<style scoped>
</style>
